import xlrd

from backend.models.project import Project
from backend.models.user import User

book = xlrd.open_workbook('projects.xlsx', encoding_override='utf8')
sheet1 = book.sheets()[0]
for i in range(sheet1.nrows):
    item = sheet1.row_values(i)
    user = User.objects().find(nickname=item[3])
    print(user)
    project = Project(
        serial=item[0],
        decree=item[1],
        title=item[2],
        head_user=user.id
    )
    print(project)
